import { utils } from 'hi-ui';
import { currentUserID } from "@/utils/common.js";
export default {
    id: "CashregisterEntity",
    returnTotal:true,
    modelFile: "database/cashregister/dataset/CashregisterEntity.xml",
    sortFields: [
        "FID",
        "FMONEYACCOUNT",
        "FDESC",
        "FPRINT",
        "FMONEYBOX",
        "FNOTE",
        "FCREATEDATE",
        "FUSERID",
        "FENTERPRISEDESC",
        "FENTERPRISEID",
    ],
    fields: {
        FID: {
            name: "FID", //字段ID
            label: "ID", //字段描述
            dbtype: "dbString", //数据类型
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.guid();
                },
            },
        },

        FMONEYACCOUNT: {
            name: "FMONEYACCOUNT", //字段ID
            label: "资金账户", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FDESC: {
            name: "FDESC", //字段ID
            label: "通用名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
        },
        FPRINT: {
            name: "FPRINT", //字段ID
            label: "打印硬件地址", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FMONEYBOX: {
            name: "FMONEYBOX", //字段ID
            label: "钱箱硬件地址", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FNOTE: {
            name: "FNOTE", //字段ID
            label: "备注", //字段描述
            dbtype: "dbString", //数据类型
            length: 250,
        },
        FENTERPRISEDESC: {
            name: "FENTERPRISEDESC", //字段ID
            label: "企业名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEID: {
            name: "FENTERPRISEID", //字段ID
            label: "企业ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FUSERID: {
            name: "FUSERID", //字段ID
            label: "用户", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return currentUserID();
                },
            },
        },
        FCREATEDATE: {
            name: "FCREATEDATE", //字段ID
            label: "创建时间", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,
            readonly: true,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },
        },
    }
}